<?php
require_once ('config.php');
require_once ('databasefunctions.php');
require_once ('displayfunctions.php');
require_once ('businessfunctions.php');
validate_user();
html_header();


switch ($_GET['action']) {
        default :
        title_bar($langexpensereport);
        ?>
		<form method = "POST" action="expense_report_print.php">
		<table>
			<tr>
				<td bgcolor='<? echo $color1 ?>'><? echo $langcompanyid ?>
				<td><select name='CompanyID'>
				<?
				$company_list = get_company_list();
				foreach ($company_list as $company) {
				        echo "<option value='" . $company['CompanyID'] . "'";
				        if ($sql_data['CompanyID'] == $company['CompanyID']) echo " SELECTED ";
				        echo ">";
				        echo $company['CompanyID'] . " - " . $company['CompanyName'];
				}
				?>
				</select>

			<tr>
				<td bgcolor='<? echo $color1 ?>'><? echo $langstaffid ?>
				<td>
				<?
				// only controller can select different staff
				if ($_SESSION['AccessLevel'] <= 2) {
				        echo "\n<select name='StaffID'>";
				        $staff_list = get_staff_list();
				        foreach ($staff_list as $member) {
				                echo "\n<option value='" . $member['StaffID'] . "'";
				                if ($sql_data['StaffID'] == $member['StaffID']) echo " SELECTED ";
				                echo ">";
				                echo $member['StaffID'] . " - " . $member['StaffName'];
				        }
				        echo "\n</select>";
				}
				else {
				        echo "<input type = 'text' name = 'StaffID' value = '" . $_SESSION['UserID'] . "' readonly>";
				}
				?>

			<tr>
				<td bgcolor='<? echo $color1 ?>'><? echo $langmonth ?>
				<td>
				<select size="1" name="Month">
  					<option value="01"><? echo $langmonth1?></option>
  					<option value="02"><? echo $langmonth2?></option>
  					<option value="03"><? echo $langmonth3?></option>
  					<option value="04"><? echo $langmonth4?></option>
  					<option value="05"><? echo $langmonth5?></option>
  					<option value="06"><? echo $langmonth6?></option>
  					<option value="07"><? echo $langmonth7?></option>
  					<option value="08"><? echo $langmonth8?></option>
  					<option value="09"><? echo $langmonth9?></option>
  					<option value="10"><? echo $langmonth10?></option>
  					<option value="11"><? echo $langmonth11?></option>
  					<option value="12"><? echo $langmonth12?></option>
				</select>
				<input name="Year" type="text" size="4" value="<? echo(date('Y')); ?>">

			<tr>
				<td bgcolor='<? echo $color1 ?>'><? echo $langwithheading ?>
				<td>
				<select size="1" name="WithHeading">
  					<option value="1"><? echo $langyes?></option>
  					<option value="0" selected><? echo $langno?></option>
  					<option value="%"><? echo $langboth?></option>

  			<tr>
				<td>
				<td><input type="submit" value="<? echo $langgenerate ?>">




        <?php
        break;

        case "print" :

        break;

}
?>
